pp108 : GetTasks ForRoles

GetTasks ForRoles

This Web service operation lists the tasks that are configured to the given roles. It takes a detail attribute with the role. When the detail attribute is set to true, the task details, including its task parts and related tasks information is fetched.

Resource URI
/v1/tasks/getTasksForRoles
Request Type

HTTP POST

HTTP Header Parameters

Parameter

Description

Accepted Input Values

SAMLart

The SAML artifact received after authentication. For more information on how to authenticate, see Login.
otdsticket The OTDSTicket received after authentication from OTDS. The OTDSTicket must be provided as a header parameter. For more information on how to authenticate, see Login.

 Note : You must provide either SAMLart or otdsticket header parameter. If you provide both the header parameters, it will internally work based on SAMLart.

 

Note: The supported output formats are:

  • JSON
  • XML
Request Parameters

Parameter

Description

Accepted Input Values

roleDn Provides information on the tasks assigned to a role. String DN value of roles like: cn=mamager,cn=organizational roles,o=system,cn=cordys,cn=defaultinst,o=opentext.net

details

If detail is set to true, the complete task definition is returned.

String value as true or false.
Note: If detail is set to true, the complete task definition is returned. 

Note: All the above parameters must be send inside attribute value of the GetTasksForRoles object in the payload section of the HTTP POST call. 

Sample HTTP Payload

POST accepts the payload content only in the XML format as follows:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<GetTasksForRoles xmlns="http://schemas.cordys.com/task/1.0/runtime/">
 <Role dn="cn=CPF_ScrumMaster,cn=organizational roles,o=system,cn=cordys,cn=OTDS_Cordys1,o=mydomain.com" detail="true"/>
 <Role dn="cn=REST_Role,cn=organizational roles,o=system,cn=cordys,cn=OTDS_Cordys1,o=mydomain.com" detail="true"/>
</GetTasksForRoles>
Sample Client Example

Add the HTTP Payload as follows:

public static void main(String[] args) throws JAXBException, ClientProtocolException, IOException {
com.cordys.entity.bean.GetTasksForRoles taskRoles = new com.cordys.entity.bean.GetTasksForRoles();
 com.cordys.entity.bean.GetTasksForRoles.Role inputRole=new com.cordys.entity.bean.GetTasksForRoles.Role();
 inputRole.setDetail("true");
 inputRole.setDn("cn=CPF_ScrumMaster,cn=organizational roles,o=system,cn=cordys,cn=OTDS_Cordys1,o=mydomain.com");
 taskRoles.setRole(inputRole); 
 com.cordys.entity.bean.GetTasksForRoles.Role inputRole1=new com.cordys.entity.bean.GetTasksForRoles.Role();
 inputRole1.setDetail("true");
 inputRole1.setDn("cn=REST_Role,cn=organizational roles,o=system,cn=cordys,cn=OTDS_Cordys1,o=mydomain.com");
 taskRoles.setRole(inputRole1);
StringWriter writer = new StringWriter();
 JAXBContext jaxbContext = JAXBContext.newInstance(com.cordys.entity.bean.GetTasksForRoles.class);
 Marshaller jaxbMarshaller = jaxbContext.createMarshaller();
 jaxbMarshaller.marshal(taskRoles, writer);
DefaultHttpClient httpClient = new DefaultHttpClient();
 // Define a postRequest request
 HttpPost postRequest = new HttpPost("http://localhost:8090/BPMService/v1/tasks/getTasksForRoles");
// Set the API media type in http content-type header
 //postRequest.addHeader("SAMLart","MDEUkKOCWs8vQY+gYqa28mHjKoN0V+gJI8/zKxA4BveCdAA/LA+COJau");
 postRequest.addHeader("otdsticket","ADDSroZIVlji5rFN3fWuVpCEWJcO06cb");
 postRequest.addHeader("content-type", "application/xml");
// Set the request post body
 StringEntity userEntity = new StringEntity(writer.getBuffer().toString());
 postRequest.setEntity(userEntity);
...
}

Note: The com.cordys.entity.bean.GetTasksForRoles object structure has been attached below, which is expected as a parameter of the REST API:

public Response transferTask(com.cordys.entity.bean.GetTasksForRoles)

GetTasksForRoles.java class is packed on BPMServiceClient.jar.

Response Parameters

Parameter

Description

Role

Role description

dn 

String DN value of roles

Sample Response
 
JSON Response : 

{
	tuple: [1]0: {
		old: {
			Role: [1]0: {
				dn: "CPF_Developer,cn=organizational roles,o=system,cn=cordys,cn=defaultinst,o=opentext.net"configTaskId: null
			}
		}
	}
}
	

 

 

Attachments: